import 'package:flutter/services.dart';

// native 调用 flutter 端功能
class NativeCallFlutter {
  static const MethodChannel _channel = const MethodChannel('flutter_plugin_a:native_call_flutter');
  NativeCallFlutter() {
    _channel.setMethodCallHandler(batteryCallHandler);
  }

  Future<dynamic> batteryCallHandler(MethodCall call) async {
    switch (call.method) {
      case "getFlutterContent":
        return "This is FlutterContent";
      case "getInt":
        return 10;
      case "getString":
        return "Hello World";
      case "getList":
        return [
          "Hello",
          "Baby"
        ];
      case "getMap":
        return {
          "aKey": "native call flutter",
          "bKey": "hello baby"
        };
    }
  }

}
